
package biblio.dao;


import biblio.domain.Author;
import biblio.exception.NoSuchEntityException;
import java.io.Serializable;
import java.util.List;


/**
 * Interface for persistance of author.
 * 
 * @author mephisto
 */
public interface AuthorDAO
{
/**
     * Persists author given as a parameter in the database.
     *
     * @param author the author to set, this entity will be persited in the database
     */
    void create(Author author);

    /**
     * Returns found authors indentified by lastName in the database or throws
     * NoSuchEntityException if such authors does not exist.
     *
     * @param lastName the lastName to set
     * @return author which is identfied by lastName
     * @throws NoSuchEntityException if no author is
     *         associated with this lastName
     */
    List<Author> find(Serializable lastName) throws NoSuchEntityException;

    /**
     * Returns the list of all authors stored in the database. List is empty
     * when no entity is stored in the database.
     *
     * @return the list of all authors stored in the database
     */
    List<Author> selectAll();

    /**
     * Updates found author in the database or throws
     * NoSuchEntityException if such author does not exist.
     *
     * @param author to set the author which will be updated
     * @throws NoSuchUserException if no User is associated with this id
     */
    void update(Author author) throws NoSuchEntityException;

    /**
     * Deletes author from the database if only exists.
     *
     * @param author to set the author which will be deleted
     */
    void delete(Author author);
}
